You can use the GetGraphicsImporterForFile function to open a suitable graphics import component for a file. (If you have a data reference rather than a file, you can use the GetGraphicsImporterForDataRef function instead.)
When the Image Compression Manager's GetGraphicsImporterForFile function searches for a graphics import component, it tries, in order:
The last stage can be time-consuming, since it involves opening many components in turn. If you want to skip it, call GetGraphicsImporterForFileWithFlags (or GetGraphicsImporterForDataRefWithFlags ) and pass the kDontUseValidateToFindGraphicsImporter flag.
If you include kQTFileTypeQuickTimeImage ( `qtif' ) in the list of types passed to StandardGetFilePreview , all files that can be opened with graphics importers are included in the file list. (The slow validate approach is not used in this case.)
When you are done with the graphics importer instance, you call CloseComponent .
If you expect to draw the same image more than once, you can improve performance by keeping the graphics importer component open, rather than creating and disposing of it each time.
Once you have a graphics import component for your file or data reference, you can query it to determine the properties of the file, configure drawing parameters, and draw or export the file. The next two sections explain how to do this.
| Previous | Chapter Contents | Chapter Top | Next |